<template>
  <div>
    <van-nav-bar title="标题" left-text="返回" right-text="按钮" left-arrow />

    <van-tabs v-model="active">
      <van-tab title="标签 1">内容 1</van-tab>
      <van-tab title="标签 2">内容 2</van-tab>
      <van-tab title="标签 3">内容 3</van-tab>
      <van-tab title="标签 4">内容 4</van-tab>
    </van-tabs>

<van-grid :column-num="2">
  <van-grid-item v-for="(item,index) in arr" :key="index"  >
        <van-image :src="item.pic" @click="$router.push('lianbiao?id=' + item._id)"></van-image>
        <p>{{ item.title }}</p>
        <van-icon name="cart-o" color="#1989fa" @click="k(item)" />
  </van-grid-item>
</van-grid>
   
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: 2,
      arr: []
    };
  },
  mounted(){
      this.axios.get('list.json').then(res => {
        //   console.log(res);
          
          this.arr = res.data.result
      })
  },
  methods:{
        k(item){
                this.$store.commit('list',item)
       this.$router.push('gwc')

        }
  }
  
};
</script>

<style scoped>
</style>